/*
 * @Date: 2019-08-31 15:00:38
 * @Github: https://github.com/FinnWu
 * @LastEditors: Finnwu
 * @LastEditTime: 2019-08-31 15:05:04
 */

 
// 跳台阶
function jumpFloor(number){
    // write code here
    if(number === 1 || number === 2) {
        return number
    }
    var pre = 1
    var next = 2
    for (var i = 3; i <= number; i++) {
        var tmp = next
        next = pre + next
        pre = tmp
    }
    return next
}

console.log(jumpFloor(2));
